Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat]: GetLines() #1258

Open
andy-wrks opened this issue Feb 9, 2025 · 1 comment
Open

[Feat]: GetLines() #1258

andy-wrks opened this issue Feb 9, 2025 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@andy-wrks
Copy link

What is your idea?

Currently there's

  • GetLine() for single lines
  • GetAllLines() for all lines in the file

A common use case is to get all lines of a specific type, like all IfcElements or all IfcPropertySingleValues. This can result in tens of thousands of lines. Getting them all in a loop as single lines has a lot of overhead. It's lots of calls to WASM which has inut/output overhead.

What would be very useful:
A GetLines() method that takes an Array or Set of expressIds and returns the line objects as an Array or Map. That way, only one call to WASM would have to be made instead of tens of thousands.

Thanks for considering this and thanks for the great work :-)

@andy-wrks andy-wrks added the enhancement New feature or request label Feb 9, 2025
@beachtom beachtom self-assigned this Feb 14, 2025
@andy-wrks
Copy link
Author

I'll document some numbers from my performance tests here and I'd be happy to test again, if the proposed method should get implemented. I wanted to get a feeling about the WASM i/o overhead. However, I soon realized that GetAllLines() does only return expressIds, not the full line objects. So there was nothing to really compare the performance of single GetLine() calls against. Still, some numbers:

Model 1 is 174 MB and has around 2 300 000 lines in total, of which 774 480 IfcPropertySingleValues were fetched from web-ifc

  • Time to get all lines (774k WASM calls) --> 4551 ms (4.5 s)

Model 2 is 535 MB and has around 8 500 000 lines in total, of which 1 419 526 IfcPropertySingleValues were fetched from web-ifc

  • Time to get all lines (1.4m WASM calls) --> 7727 ms (7.7 s)

Times were measured in Chrome on an older i7 CPU in a kind of "best of 10 attempts" manner.
Firefox was consistently slower, although it was consistently 15-20% faster than Chrome in initially parsing the model.

I hope these numbers can be of interest in finding out how much time is actually being spent "inside" WASM and how much overhead is added through hundreds of thousands of individual method calls and i/o conversions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants