Comments (7)
What is taking time in TBTextFragment::Paint then?
Are you using many fonts? I guess the GetFont call in it could be slow.
I haven't had any performance problems with it.
For normal text, there shouldn't be many text fragments. But with things like many word-breaking characters, it could be pretty bad, resulting in one fragment per character. Imagine f.ex a line like "====================================="
Avoiding fragments unless styling or wrapping requires it would be an interesting optimization.
from turbobadger.
27ms spent in TBEditField::OnPaint seems insanely slow but i guess profiling itself made it a lot slower?
from turbobadger.
No, that's the entire reason I started profiling it. The profiler I'm using has an overhead of about ~50us if I remember correctly (per begin/end call for the zones).
The text in question was a relatively simple piece of text with average word lengths, nothing super long like that. There's some word wrapping involved though.
The font used is a Truetype font, too. Perhaps that has something to do with it, but considering it caches all the characters on a bitmap I don't think that could be the issue.
from turbobadger.
I did some profiling on master and made some optimizations (will try to push something within a few days..). However, on the shape rasterizer branch, the new kerning support is adding 30% cost for drawing text compared to the nonkerned version on master (all in GetAdvance). That's with STBFontRenderer. I haven't tried freetype. Maybe glyph advances should be cached.
TBEditField doesn't measure during painting though, so that doesn't really explain this issue.
from turbobadger.
Thank you! I had a suspicion that the rasterizer branch would have some changes that caused it to be a bit slower. I'll have to try and revert our codebase back to master branch and see if that solves the issue.
from turbobadger.
@codecat What is that profiler? It looks quite nice.
from turbobadger.
It's actually an in-house profiler that we made at @Crackshell that we've wanted to release as an open source project, but never got around to it yet.
from turbobadger.
Related Issues (20)
- Glyph collision in hashmap
- Korean input not support under Windows HOT 5
- Window without System Window HOT 2
- Fonts switch HOT 2
- Unicode language Input with Extra Enter HOT 1
- Remove scroll bar of TBEditField HOT 2
- The Relationship with AtomicEngine's Turbobadger HOT 2
- TBImageManager improvements
- Need update to new version of third lib stb_image
- Suggestion on how to best implement drag and drop between item source views.
- Missing TBMover factory
- how to run the tests ? HOT 1
- TBLayout: one fixed item and one item take remaining space HOT 1
- How should I use TBWidgetsReader to set up a widget?
- gcc9 warning
- Nice project. But it was abandoned? HOT 6
- It works on emscripten/wasm? HOT 1
- OnInflateChild question HOT 4
- Dawing custom shapes HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from turbobadger.