mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 15:56:13 +03:00
add some TODOs
This commit is contained in:
5
TODO.md
Normal file
5
TODO.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
Performance:
|
||||||
|
|
||||||
|
* libuv allocates on every read, we should use a read buffer pool
|
||||||
|
* update cells for drawing should just happen once per frame
|
||||||
|
* update cells should only update the changed cells
|
@ -57,7 +57,7 @@ write_req_pool: SegmentedPool(libuv.WriteReq.T, WRITE_REQ_PREALLOC) = .{},
|
|||||||
|
|
||||||
/// The pool of available buffers for writing to the pty.
|
/// The pool of available buffers for writing to the pty.
|
||||||
/// TODO: [1]u8 is probably not right.
|
/// TODO: [1]u8 is probably not right.
|
||||||
buf_pool: SegmentedPool([1]u8, WRITE_REQ_PREALLOC) = .{},
|
write_buf_pool: SegmentedPool([1]u8, WRITE_REQ_PREALLOC) = .{},
|
||||||
|
|
||||||
/// Set this to true whenver an event occurs that we may want to wake up
|
/// Set this to true whenver an event occurs that we may want to wake up
|
||||||
/// the event loop. Only set this from the main thread.
|
/// the event loop. Only set this from the main thread.
|
||||||
@ -220,7 +220,7 @@ pub fn destroy(self: *Window) void {
|
|||||||
const alloc = win.alloc;
|
const alloc = win.alloc;
|
||||||
t.deinit(alloc);
|
t.deinit(alloc);
|
||||||
win.write_req_pool.deinit(alloc);
|
win.write_req_pool.deinit(alloc);
|
||||||
win.buf_pool.deinit(alloc);
|
win.write_buf_pool.deinit(alloc);
|
||||||
win.alloc.destroy(win);
|
win.alloc.destroy(win);
|
||||||
}
|
}
|
||||||
}).callback);
|
}).callback);
|
||||||
@ -283,7 +283,7 @@ fn charCallback(window: glfw.Window, codepoint: u21) void {
|
|||||||
|
|
||||||
// Write the character to the pty
|
// Write the character to the pty
|
||||||
const req = win.write_req_pool.get() catch unreachable;
|
const req = win.write_req_pool.get() catch unreachable;
|
||||||
const buf = win.buf_pool.get() catch unreachable;
|
const buf = win.write_buf_pool.get() catch unreachable;
|
||||||
buf[0] = @intCast(u8, codepoint);
|
buf[0] = @intCast(u8, codepoint);
|
||||||
win.pty_stream.write(
|
win.pty_stream.write(
|
||||||
.{ .req = req },
|
.{ .req = req },
|
||||||
@ -312,7 +312,7 @@ fn keyCallback(
|
|||||||
|
|
||||||
const win = window.getUserPointer(Window) orelse return;
|
const win = window.getUserPointer(Window) orelse return;
|
||||||
const req = win.write_req_pool.get() catch unreachable;
|
const req = win.write_req_pool.get() catch unreachable;
|
||||||
const buf = win.buf_pool.get() catch unreachable;
|
const buf = win.write_buf_pool.get() catch unreachable;
|
||||||
buf[0] = c;
|
buf[0] = c;
|
||||||
win.pty_stream.write(
|
win.pty_stream.write(
|
||||||
.{ .req = req },
|
.{ .req = req },
|
||||||
@ -373,7 +373,7 @@ fn ttyWrite(req: *libuv.WriteReq, status: i32) void {
|
|||||||
const tty = req.handle(libuv.Tty).?;
|
const tty = req.handle(libuv.Tty).?;
|
||||||
const win = tty.getData(Window).?;
|
const win = tty.getData(Window).?;
|
||||||
win.write_req_pool.put();
|
win.write_req_pool.put();
|
||||||
win.buf_pool.put();
|
win.write_buf_pool.put();
|
||||||
|
|
||||||
libuv.convertError(status) catch |err|
|
libuv.convertError(status) catch |err|
|
||||||
log.err("write error: {}", .{err});
|
log.err("write error: {}", .{err});
|
||||||
|
Reference in New Issue
Block a user